const mysql      = require('mysql');
const connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : 'root',
  database : 'demohoc'
});
 
const query=(sql)=>{
    return new Promise((resolve, reject) => {
        connection.query(sql, function (error, results) {
  if (error){
    reject(error)
  }
  resolve(results)
});
 
    })
}

module.exports=query
 
